home *** CD-ROM | disk | FTP | other *** search
- /*
- File: FragmentStuff.h
-
- Contains: Data structures which define the 'cfrg' resource format
- and a our own independent data structure containing the
- information we need, in a simple format.
-
- Written by: Chris White, Developer Technical Support
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- 9/28/95 CW First release
-
- */
-
-
- #ifndef __FRAGMENTSTUFF__
- #define __FRAGMENTSTUFF__
-
-
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
-
-
-
- // The format of the 'cfrg' on disk. This is defined in <CodeFragmentTypes.r>
- #ifdef powerc
- #pragma options align=mac68k
- #endif
-
-
- struct cfrgHeader
- {
- long res1;
- long res2;
- long version;
- long res3;
- long res4;
- long filler1;
- long filler2;
- long itemCount;
- char arrayStart; // Array of externalItems begins here
- };
- typedef struct cfrgHeader cfrgHeader, *hdrPtr, **hdrHand;
-
- struct cfrgItem
- {
- OSType archType;
- long updateLevel;
- long currVersion;
- long oldDefVersion;
- long appStackSize;
- short appSubFolder;
- char usage;
- char location;
- long codeOffset;
- long codeLength;
- long res1;
- long res2;
- short itemSize; // %4 == 0
- Str255 name;
- // Only make the final p-string as long as needed, then align to
- // a longword boundary
- };
- typedef struct cfrgItem cfrgItem;
- #ifdef powerc
- #pragma options align=reset
- #endif
-
-
- struct TempFileRec
- {
- int usageCount;
- FSSpec fileSpec;
- };
-
- typedef struct TempFileRec tTempFileRec, *tTempFilePtr;
-
-
- /* Record for each fragment. Includes simplified version of the 'cfrg' data */
- struct internalItem
- {
- /* Data used for the application */
- Boolean bDeleted;
- Boolean bExistsInDocument;
- tTempFilePtr tempFilePtr;
-
- /* Data included in the 'cfrg' resource */
- OSType archType;
- long updateLevel;
- long currVersion;
- long oldDefVersion;
- long appStackSize;
- short appSubFolder;
- short usage;
- short location;
- long codeOffset;
- long codeLength;
- Str255 name;
- };
- typedef struct internalItem tItem, *tItemPtr;
-
- struct internalResource {
- long version;
- long itemCount;
- tItem itemList[1];
- };
- typedef struct internalResource tHeader, *tHeaderPtr, **tHeaderHan;
-
- /* ===== Prototypes ===== */
- OSErr ParseResource (Handle theResource, tHeaderHan internalCopy);
- OSErr BuildResource (tHeaderHan internalCopy, Handle theResource);
-
-
-
-
- #endif // define __FRAGMENTS__
-